﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Hangout.Web.Services.Trophy
{
    public class Trophy
    {
        Web.Model.HangoutDBEntities context = new Web.Model.HangoutDBEntities();
        public  List<Objects.Trophy> GetUserTrophies(int userId)
        {
            try
            {
                
                    return Web.Core.Trophy.Trophy.GetUserTrophies(userId, ref context).Select(o=>new Objects.Trophy{TrophyPic=o.BadgePic,Description=o.BadgeDescription,Name=o.BadgeName,TrophyID=o.BadgeID}).ToList();
                
               
            }
            catch (System.Exception ex)
            {
                Web.Core.Exceptions.ExceptionReporting.AddAnException(userId, Web.Core.ClientType.WindowsAzure, ex, ref context);
                return null;
            }
        }
    }
}